export const toHMS = (a) => {
  if (a === '--') return '--'
  a = a + ''
  if (a.charAt(a.length - 1) === 's') {
    a = a.substr(0, a.length - 1)
  }
  if (a.includes(':')) return a
  a = Number(a)
  if (isNaN(a)) return ''
  var flag = a < 0
  a = Math.abs(a)
  var hh = parseInt(a / 3600);
  if (hh < 10) hh = '0' + hh;
  var mm = parseInt((a - hh * 3600) / 60);
  if (mm < 10) mm = '0' + mm;
  var ss = Math.round((a - hh * 3600) % 60);
  if (ss < 10) ss = '0' + ss;
  var length = hh + ':' + mm + ':' + ss;
  if (flag) length = '-' + length
  return length
}
